package com.example.shop_2302.room

import androidx.lifecycle.MutableLiveData
import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query

@Dao
interface CommentDao {
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insert(comment: Comment)
    @Query("select * from comment where goodsid = :goodsid")
    fun queryAll(goodsid:Int):MutableList<Comment>
    //模糊查询
    @Query("select * from comment where goodsid = :goodsid and msg like '%'||:keyword||'%'")
    fun query(keyword:String,goodsid: Int):MutableList<Comment>
}